﻿using System;

namespace ExFlash.Records
{
    public class ZoneRecord : ISwfSerializable
    {
        public Byte NumZoneData
        {
            get;
            private set;
        }

        public ZoneData[] ZoneData
        {
            get;
            private set;
        }

        public Boolean ZoneMaskY
        {
            get;
            private set;
        }

        public Boolean ZoneMaskX
        {
            get;
            private set;
        }

        #region ISwfSerializable Members

        public void SwfDeserialize(BinaryBitReader reader)
        {
            NumZoneData = reader.ReadByte();

            ZoneData = new ZoneData[NumZoneData];

            for (int i = 0; i < NumZoneData; i++)
            {
                ZoneData[i].SwfDeserialize(reader);
            }

            //Reserved
            reader.SkipBits(6);

            ZoneMaskY = reader.ReadBoolean();
            ZoneMaskX = reader.ReadBoolean();

            reader.AlignBits();
        }

        public void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
